<template>
	<view class="example">
		<text class="title">使用默认值`value`,自定义`treeOptions`</text>
		<ifun-legacy-tree-picker :value="value" :data="treeData" :treeOptions="options" @ok="handleConfirm">

		</ifun-legacy-tree-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value:{code:'02001'},
				options:{
					value:'code'
				},
				treeData: [{
						label: "北京",
						code: "01",
						children: [{
							label: "北京",
							code: "01001",
							children: [{
									label: "北京城西",
									code: "01001001",
								},
								{
									label: "北京城东",
									code: "01001002",
								}
							]
						}]
					},
					{
						label: "江苏",
						code: "02",
						children: [{
								label: "南京",
								code: "02001",
							},
							{
								label: "南通",
								code: "02002",
								children: [{
										label: "南通城西",
										code: "02002001",
									},
									{
										label: "南通城东",
										code: "02002003",
									},
									{
										label: "南通城北",
										code: "02002004",
									},
									{
										label: "南通城南",
										code: "02002005",
									}
								]
							}
						]
					},
				]
			}
		},
		methods:{
			handleConfirm(node,nodes){
				console.log(node,nodes)
			}
		}
	}
</script>

<style>
</style>